from django.conf.urls import include, url
from django.contrib import admin
from django.views.decorators.csrf import csrf_exempt
from . import views

urlpatterns = [
    # url(r'^admin/', include(admin.site.urls)),
    url(r'^users$', views.UsersView.as_view(), name='ac-users'),
    url(r'^users/(?P<pk>[0-9]+)$', views.UserView.as_view(), name='ac-user'),
    url(r'^test2$', views.Test2.as_view(), name='test2'),
    url(r'^status$', views.StatusManyView.as_view(), name='ac-status-many'),
    url(r'^status/(?P<status_code>[0-9]+)$', views.StatusView.as_view(), name='ac-status'),
    url(r'^projects$', views.ProjectsView.as_view(), name='ac-projects'),
    url(r'^query_user$', views.QueryUserView.as_view(), name='ac-query-user'),

    url(r'^org$', views.OrginazeView.as_view(), name='ac-orgs'),
    url(r'^org/(?P<pk>[0-9]+)$', views.OrgView.as_view(), name='ac-org'),
    url(r'^org_level$', views.OrgLevelsView.as_view(), name='ac-org-levels'),
    url(r'^org_level/(?P<level>[0-9]+)$', views.OrgLevelView.as_view(), name='ac-org-level'),
    url(r'^org_role$', views.OrgRolesView.as_view(), name='ac-org-roles'),
    url(r'^org_role/(?P<pk>[0-9]+)$', views.OrgRoleView.as_view(), name='ac-org-role'),
    url(r'^user_org$', views.UserOrgsView.as_view(), name='ac-user-orgs'),
    url(r'^user_org/(?P<user_id>[0-9]+)&(?P<org_id>[0-9]+)$', views.UserOrgView.as_view(), name='ac-user-org'),
    url(r'^site$', views.SitesView.as_view(), name='ac-sites'),
    url(r'^site/(?P<pk>[0-9]+)$', views.SiteView.as_view(), name='ac-site'),
    url(r'^duty$', views.DutysView.as_view(), name='ac-dutys'),
    url(r'^duty/(?P<pk>[0-9]+)$', views.DutyView.as_view(), name='ac-duty'),


    url(r'^check_user$', views.CheckUserView.as_view(), name='ac-check-user'),
    url(r'^check_token$', views.CheckTokenView.as_view(), name='ac-check-token'),
    url(r'^login$', views.LoginView.as_view(), name='ac-login'),
    url(r'^logout$', views.LogoutView.as_view(), name='ac-logout'),
    url(r'^QR_code_login$', views.QRCodeLoginView.as_view(), name='ac-QR-code-login'),
    url(r'^bulk_import$', views.BulkImportView.as_view(), name='ac-bulk-import'),
    url(r'^active_user$', views.ActiveUserView.as_view(), name='ac-active_user'),

    url(r'^retrieve_pwd$', views.RetrievePWDView.as_view(), name='ac-retrieve-pwd'),
    url(r'^set_new_pwd$', views.SetNewPWDView.as_view(), name='ac-set-new-pwd'),
    url(r'^update_pwd$', views.UpdatePWDView.as_view(), name='ac-update-pwd'),
]


# urlpatterns = [
#     # url(r'^admin/', include(admin.site.urls)),
#     url(r'^users$', csrf_exempt(views.UsersView.as_view()), name='ac-users'),
#     url(r'^users/(?P<pk>[0-9]+)$', csrf_exempt(views.UserView.as_view()), name='ac-user'),
#     url(r'^test2$', csrf_exempt(views.Test2.as_view()), name='test2'),
#     url(r'^status$', csrf_exempt(views.StatusManyView.as_view()), name='ac-status-many'),
#     url(r'^status/(?P<status_code>[0-9]+)$', csrf_exempt(views.StatusView.as_view()), name='ac-status'),
#     url(r'^projects$', csrf_exempt(views.ProjectsView.as_view()), name='ac-projects'),
#     url(r'^query_user$', csrf_exempt(views.QueryUserView.as_view()), name='ac-query-user'),
#
#     url(r'^org$', csrf_exempt(views.OrginazeView.as_view()), name='ac-orgs'),
#     url(r'^org/(?P<pk>[0-9]+)$', csrf_exempt(views.OrgView.as_view()), name='ac-org'),
#     url(r'^org_level$', csrf_exempt(views.OrgLevelsView.as_view()), name='ac-org-levels'),
#     url(r'^org_level/(?P<level>[0-9]+)$', csrf_exempt(views.OrgLevelView.as_view()), name='ac-org-level'),
#     url(r'^org_role$', csrf_exempt(views.OrgRolesView.as_view()), name='ac-org-roles'),
#     url(r'^org_role/(?P<pk>[0-9]+)$', csrf_exempt(views.OrgRoleView.as_view()), name='ac-org-role'),
#     url(r'^user_org$', csrf_exempt(views.UserOrgsView.as_view()), name='ac-user-orgs'),
#     url(r'^user_org/(?P<user_id>[0-9]+)&(?P<org_id>[0-9]+)$', csrf_exempt(views.UserOrgView.as_view()), name='ac-user-org'),
#     url(r'^site$', csrf_exempt(views.SitesView.as_view()), name='ac-sites'),
#     url(r'^site/(?P<pk>[0-9]+)$', csrf_exempt(views.SiteView.as_view()), name='ac-site'),
#     url(r'^duty$', csrf_exempt(views.DutysView.as_view()), name='ac-dutys'),
#     url(r'^duty/(?P<pk>[0-9]+)$', csrf_exempt(views.DutyView.as_view()), name='ac-duty'),
#
#
#     url(r'^check_user$', csrf_exempt(views.CheckUserView.as_view()), name='ac-check-user'),
#     url(r'^login$', csrf_exempt(views.LoginView.as_view()), name='ac-login'),
#     url(r'^logout$', csrf_exempt(views.LogoutView.as_view()), name='ac-logout'),
#     url(r'^QR_code_login$', csrf_exempt(views.QRCodeLoginView.as_view()), name='ac-QR-code-login'),
#     url(r'^bulk_import$', csrf_exempt(views.BulkImportView.as_view()), name='ac-bulk-import'),
#     url(r'^active_user$', csrf_exempt(views.ActiveUserView.as_view()), name='ac-active_user'),
#
#     url(r'^retrieve_pwd$', csrf_exempt(views.RetrievePWDView.as_view()), name='ac-retrieve-pwd'),
#     url(r'^set_new_pwd$', csrf_exempt(views.SetNewPWDView.as_view()), name='ac-set-new-pwd'),
#     url(r'^update_pwd$', csrf_exempt(views.UpdatePWDView.as_view()), name='ac-update-pwd'),
# ]
